package com.lcb.spring;

import com.lcb.spring.config.MainConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
       /* ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        System.out.println(context.getBean("car"));*/

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MainConfig.class);
        String[] beanDefinitionNames = context.getBeanDefinitionNames();
        for (String name : beanDefinitionNames
        ) {
            System.out.println("bean的定义信息" + name);
        }
        System.out.println(context.getBean("lcbFactoryBean"));
        System.out.println(context.getBean("&lcbFactoryBean"));
    }
}
